package com.example.test_1;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;


import androidx.appcompat.app.AppCompatActivity;



/**
    Android四大组件：Activity Service ContentProvider BroadcastReceiver
    Activity 用于显示界面，处理交互事件

 */

public class ActivityJiChu extends AppCompatActivity {

    /**
     Activity生命周期:
      onCreate 被创建
      onStart 即将可见
      onResume 可见可交互（有焦点）
      onPause 可见但失去焦点（不可交互）
      onStop 不可见
      onDestroy 被销毁
      onRestart 重新可见
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //加载布局
        setContentView(R.layout.activity_ji_chu);
        Log.d("TAG", "A onCreate: ");
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.d("TAG", "A onStart: ");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.d("TAG", "A onResume: ");
    }


    @Override
    protected void onPause() {
        super.onPause();
        Log.d("TAG", "A onPause: ");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.d("TAG", "A onStop: ");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.d("TAG", "A onDestroy: ");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.d("TAG", "A onRestart: ");
    }

    public void tiaD(View view) {
        //intent 就是用来构建你要跳转的界面，需要传两个参数，第一个是context上下文，第二个参数是要跳转的activity的class
        Intent intent = new Intent(this, demoListView.class);
        startActivity(intent);
    }
}